#ifndef BYTESTREAM_H
#define BYTESTREAM_H




class ByteStream
{
  public:
    ByteStream(int BufferSize);
    ~ByteStream();

    void Write(unsigned char* Data,int Length);
    void Read(unsigned char* Data,int Length);
    int TryWrite(unsigned char* Data,int Length);
    int TryRead(unsigned char* Data,int Length);

  private:
    unsigned char* Buffer;
    int BufferSize;
    int I;
    int O;

    void* Lock;
    void* InEvent;
    void* OutEvent;

};




#endif // BYTESTREAM_H
